package stack;

public class MyStackDemo {

    public static void main(String[] args) {

        MyStack as = new MyArrayStack(2);
        as.push(1);
        as.push(2);
        System.out.println(as);
        System.out.println(as.pop());
        System.out.println(as.peek());

        MyStack<Integer> lks = new MyLinkedStack<>();
        lks.push(1);
        lks.push(2);
        System.out.println(lks);
        System.out.println(lks.pop());
        System.out.println(lks.peek());

        MyStack<Integer> ls = new MyListStack<>();
        ls.push(1);
        ls.push(2);
        System.out.println(ls);
        System.out.println(ls.pop());
        System.out.println(ls.peek());
    }
}
